import request from '@/config/axios'

// 三方商品分类 VO
export interface ProductCategoryThirdVO {
  categoryName: string // 分类名称
  id: number // ID
  picUrl: string // 图片路径
  seq: number // 显示顺序
  parentCode: string // 父集CODE
  status: number // 状态
  categoryCode: string // 主键
}

// 三方商品分类 API
export const ProductCategoryThirdApi = {
  // 查询三方商品分类分页
  getProductCategoryThirdPage: async (params: any) => {
    return await request.get({ url: `/team/product-category-third/page`, params })
  },

  // 查询三方商品分类详情
  getProductCategoryThird: async (id: number) => {
    return await request.get({ url: `/team/product-category-third/get?id=` + id })
  },

  // 新增三方商品分类
  createProductCategoryThird: async (data: ProductCategoryThirdVO) => {
    return await request.post({ url: `/team/product-category-third/create`, data })
  },

  // 修改三方商品分类
  updateProductCategoryThird: async (data: ProductCategoryThirdVO) => {
    return await request.put({ url: `/team/product-category-third/update`, data })
  },

  // 删除三方商品分类
  deleteProductCategoryThird: async (id: number) => {
    return await request.delete({ url: `/team/product-category-third/delete?id=` + id })
  },

  // 导出三方商品分类 Excel
  exportProductCategoryThird: async (params) => {
    return await request.download({ url: `/team/product-category-third/export-excel`, params })
  },
}